package com.eachann.loading.dialog.application

import android.os.Bundle
import android.os.Handler
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.eachann.loading.dialog.LoadingDialog

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    fun showDialog(view: View) {
        LoadingDialog.show(supportFragmentManager)
        Handler().postDelayed({
            LoadingDialog.dismiss(supportFragmentManager)
        }, 5000L)
    }

    fun showCancelableDialog(view: View) {
        LoadingDialog.show(supportFragmentManager, true)
    }
}
